<?php

namespace IDock\Insurance\ZYIC\Request;

use IDock\Insurance\ZYIC\ZYICEnums;
use IDock\Insurance\ZYIC\Request\AllZYICRequest;
use IDock\Insurance\ZYIC\Response\UnderwritingResponse;
use IDock\Visitor\Premium\PremiumInquiryVisitor;
use IDock\Visitor\SpecialClausesVisitor;

class UnderwritingRequest extends AllZYICRequest
{
    public $route = 'channelInterface/V06';

    protected $response = UnderwritingResponse::class;

    protected $urlTip = '提交核保';

    /*** @var  PremiumInquiryVisitor $visitor */
    protected $visitor;

    public function generate(): array
    {
        $arr = [
            'proposalNo' => ($this->visitor->getExtInfoVisitor()->argc['proposalNoBI'] ?? '') ?: ($this->visitor->getExtInfoVisitor()->argc['proposalNoCI'] ?? ''),
            'proposalNoCI' => '',
            'certiType' => 'T',//“T”投保单业务“E”批单业务
        ];
        if(!empty($this->visitor->getExtInfoVisitor()->argc['proposalNoCI']) && !empty($this->visitor->getExtInfoVisitor()->argc['proposalNoBI'])){
            $arr['proposalNoCI'] = $this->visitor->getExtInfoVisitor()->argc['proposalNoCI'];
            $arr['proposalNo'] = $this->visitor->getExtInfoVisitor()->argc['proposalNoBI'];
        }
        return $arr;
    }


}
